import { defineFakeRoute } from "vite-plugin-fake-server/client";

// export default 
defineFakeRoute([
    {
        url: "/system/system/v2/config/list",
        method: "get",
        response: () => {
            return {
                "code": 100,
                "msg": "ok",
                "result": {
                    "data": [{
                        "group": "基础设置",
                        "child": [{
                            "name": "上传",
                            "alias": "base"
                        }, {
                            "name": "系统",
                            "alias": "system"
                        }]
                    }, {
                        "group": "支付设置",
                        "child": [{
                            "name": "支付宝设置",
                            "alias": "alipay"
                        }, {
                            "name": "微信设置",
                            "alias": "wechatpay"
                        }]
                    }, {
                        "group": "系统设置",
                        "child": [{
                            "name": "上传",
                            "alias": "base"
                        }, {
                            "name": "系统",
                            "alias": "system"
                        }]
                    }, {
                        "group": "管理设置",
                        "child": [{
                            "name": "组织架构",
                            "alias": "zhuzhi"
                        }]
                    }]
                }
            }
        }
    },
    {
        url: "/system/system/v2/config/info",
        method: "get",
        response: () => {
            return {
                "code": 100,
                "result": {
                    "data": {
                        "SiteName": "我是一只小小鸟",
                        "Desc": "",
                        "CrossOpen": true,
                        "Route": "/bird",
                        "UseDashboard": true,
                        "Username": "birdBird123",
                        "Password": "Ii1a2448add5b09067",
                        "LogLevel": 3,
                        "SignConfig": {
                            "Open": false,
                            "TokenName": "Token",
                            "SignName": "Sign",
                            "SignSecret": ""
                        },
                        "VisitConfig": {
                            "MaxConnect": 0,
                            "RepeatCheckTime": 0
                        },
                        "SessionConfig": {
                            "SessionName": "BIRD-ID",
                            "MaxAge": 1800,
                            "UseRedis": false,
                            "RedisHost": "127.0.0.1:16379",
                            "RedisPassword": "xxj_XXY",
                            "RedisDB": "3"
                        },
                        "WhiteIP": null
                    },
                    "struct": [{
                        "field": "SiteName",
                        "name": "站点名称",
                        "desc": "",
                        "mode": "",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "Desc",
                        "name": "站点说明",
                        "desc": "",
                        "mode": "text",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "CrossOpen",
                        "name": "是否允许跨域访问",
                        "desc": "",
                        "mode": "judge",
                        "type": "bool",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "Route",
                        "name": "管理路由",
                        "desc": "重启后生效",
                        "mode": "",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "UseDashboard",
                        "name": "是否启用管理面板",
                        "desc": "默认启用",
                        "mode": "judge",
                        "type": "bool",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "Username",
                        "name": "管理账号",
                        "desc": "登录账号为字母数字组合",
                        "mode": "",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "Password",
                        "name": "管理密码",
                        "desc": "密码必须包含大小写字母、数字三种数据类型",
                        "mode": "password",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }, {
                        "field": "LogLevel",
                        "name": "日志保存等级",
                        "desc": "超过该等级才保存日志",
                        "mode": "single",
                        "type": "int",
                        "options": [{
                            "label": "调试",
                            "value": 1
                        }, {
                            "label": "记录",
                            "value": 2
                        }, {
                            "label": "警告",
                            "value": 3
                        }, {
                            "label": "致命",
                            "value": 4
                        }],
                        "childs": []
                    }, {
                        "field": "SignConfig",
                        "name": "签名认证",
                        "desc": "采用Sha256加密，判断Sha256(token,secret)==sign，重启后生效",
                        "mode": "group",
                        "type": "object",
                        "options": [],
                        "childs": [{
                            "field": "Open",
                            "name": "是否启用",
                            "desc": "默认不启用",
                            "mode": "judge",
                            "type": "bool",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "TokenName",
                            "name": "口令Head头key值",
                            "desc": "默认Token",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "SignName",
                            "name": "签名Head头key值",
                            "desc": "默认Sign",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "SignSecret",
                            "name": "签名密匙",
                            "desc": "",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }]
                    }, {
                        "field": "VisitConfig",
                        "name": "访问限制",
                        "desc": "重启生效",
                        "mode": "group",
                        "type": "object",
                        "options": [],
                        "childs": [{
                            "field": "MaxConnect",
                            "name": "最大访问量",
                            "desc": "小于1则不限制，默认0",
                            "mode": "",
                            "type": "int",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "RepeatCheckTime",
                            "name": "重复提交检测时间",
                            "desc": "单位：秒，小于1则不限制，默认0",
                            "mode": "",
                            "type": "int",
                            "options": [],
                            "childs": []
                        }]
                    }, {
                        "field": "SessionConfig",
                        "name": "session配置",
                        "desc": "重启生效",
                        "mode": "group",
                        "type": "object",
                        "options": [],
                        "childs": [{
                            "field": "SessionName",
                            "name": "session名称",
                            "desc": "默认BIRD-ID",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "MaxAge",
                            "name": "session会话有效时长",
                            "desc": "单位：秒",
                            "mode": "",
                            "type": "int",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "UseRedis",
                            "name": "是否启用reids",
                            "desc": "默认使用内存",
                            "mode": "judge",
                            "type": "bool",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "RedisHost",
                            "name": "redis服务器地址",
                            "desc": "",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "RedisPassword",
                            "name": "redis服务器密码",
                            "desc": "",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }, {
                            "field": "RedisDB",
                            "name": "redis数据库号",
                            "desc": "",
                            "mode": "",
                            "type": "string",
                            "options": [],
                            "childs": []
                        }]
                    }, {
                        "field": "WhiteIP",
                        "name": "控制台访问IP白名单",
                        "desc": "重启生效",
                        "mode": "list",
                        "type": "string",
                        "options": [],
                        "childs": []
                    }]
                },
                "msg": null
            }
        }
    }, {
        url: "/system/system/v2/config/save",
        method: "put",
        response: () => {
            return {
                "code": 100,
                "msg": "ok"
            }
        }
    }, {
        url: "/system/system/v2/sys",
        method: "GET",
        response: () => {
            return {
                "code": 200,
                "msg": null,
                "result": [{
                    "systemId": 1,
                    "systemName": "xxx"
                }]
            }
        }
    }, {
        url: "/system/system/v2/system",
        method: "DELETE",
        response: () => {
            return {
                "code": 200,
                "msg": "删除成功",
                "result": null
            }
        }
    }, {
        url: "/system/system/v2/systems",
        method: "GET",
        response: () => {
            return {
                "code": 200,
                "msg": null,
                "result": {
                    "total": 20,
                    "data": [{
                        "id": 1,
                        "parentId": 1,
                        "systemName": "系统名称",
                        "systemDesc": "系统说明"
                    }]
                }
            }
        }
    }, {
        url: "/system/system/v2/system",
        method: "PUT",
        response: () => {
            return {
                "code": 200,
                "msg": "修改成功",
                "result": null
            }
        }
    }, {
        url: "/system/system/v2/system",
        method: "GET",
        response: () => {
            return {
                "code": 200,
                "msg": null,
                "result": {
                    "id": 1,
                    "systemName": "系统名称",
                    "logo": "系统图标",
                    "productIds": [1]
                }
            }
        }
    }, {
        url: "/system/system/v2/system",
        method: "POST",
        response: () => {
            return {
                "code": 200,
                "msg": "添加成功",
                "result": null
            }
        }
    },
]);
